package tests;

import org.xbill.DNS.*;
import org.xbill.DNS.utils.base64;

import java.util.Iterator;
import java.io.IOException;
import java.net.UnknownHostException;

/**
 */
public class DNS
{
  public static void main(String[] args) throws IOException{
	  Record [] records = new Lookup("gmail.com", Type.MX).run();
	  for (int i = 0; i < records.length; i++) {
	  	MXRecord mx = (MXRecord) records[i];
	  	System.out.println("Host " + mx.getTarget() + " has preference "+ mx.getPriority());
	  }
  }
}